

// ignore_for_file: prefer_const_constructors, constant_identifier_names, prefer_const_literals_to_create_immutables

import 'package:flutter_getx_1/page/home/index.dart';
import 'package:get/get.dart';

import '../middleware/router_auth.dart';
import '../page/DetailView/DetailView.dart';
import '../page/NestedNavView/navview.dart';
import '../page/NestedNavView/binding.dart';
import '../page/dependency/lazyput/binding.dart';
import '../page/dependency/lazyput/index.dart';
import '../page/dependency/put_find/first_index.dart';
import '../page/language/language.dart';
import '../page/state/getbuild/getbuild.dart';
import '../page/state/getx/getx.dart';
import '../page/list/List.dart';
import '../page/404/NotfoundView.dart';
import '../page/my/my.dart';
import '../page/state/obx/obx.dart';
import '../page/state/valuebuilder/valuebuilder.dart';
import '../page/state/workers/workers.dart';
import '../page/theme/theme.dart';
part 'app_routes.dart';

class AppPages {
  static const INITIAL = AppRoutes.Home;

  static final List<GetPage> pages = [
    
    // 嵌套导航
    GetPage(
      name: AppRoutes.NestedNavigator,
      page: () => NestedNavView(),
      binding: NestedBinding(),
    ),

    // 我的，中间件认证
    GetPage(
      name: AppRoutes.My,
      page: () => MyView(),
      middlewares: [
        RouteAuthMiddleware(priority: 1),
      ],
    ),

    // state 状态
    GetPage(
      name: AppRoutes.State,
      page: () => StateObx(),
      children: [
        GetPage(name: AppRoutes.Obx, page: () => StateObx()),
        GetPage(name: AppRoutes.Getx, page: () => GetxView()),
        GetPage(name: AppRoutes.ValueBuilder, page: () => ValueBuilderSta()),
        GetPage(name: AppRoutes.GetBuilder, page: () => GetxBuilder()),
        GetPage(name: AppRoutes.Workers, page: () => StateWorkersView()),
      ]
    ),

    // 控制器依赖注入
    GetPage(
      name: AppRoutes.Dependency,
      page: () => PutFindPage1(),
      children: [
        GetPage(
          name: AppRoutes.PutFind, page: () => PutFindPage1()
        ),
        GetPage(
          name: AppRoutes.LazyPut, binding: LazyPutBinding(), page: () => StateLazyPutView()
        ),
      ]
    ),

    // 主题
    GetPage(name: AppRoutes.Theme, page: () => ThemeView()),

    // 多语言
    GetPage(name: AppRoutes.Lang, page: () => LanguageView()),

    GetPage(
      name: AppRoutes.Home,
      page: () => HomeView(),
      children: [
        GetPage(
          name: AppRoutes.List,
          page: () => ListIndexView(),
          transition: Transition.rightToLeft,
          children: [
            GetPage(
              name: AppRoutes.Detail,
              page: () => DetailView(),
              transition: Transition.downToUp,
            ),
            GetPage(
              name: AppRoutes.Detail_ID,
              page: () => DetailView(),
              transition: Transition.downToUp,
            )
          ]
        )
      ]
    )
  ];
  static final unknownRoute = GetPage(
    name: AppRoutes.NotFound,
    page: () => NotfoundView(),
  );

}

